<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 函数参数的默认值
    function foo(bar,enable = true) {
      // enable = enable || true
      // enable = enable === undefined ? true : enable
      console.log('foo invoked enable:')
      console.log(enable)
    }
    foo('bar')
  </script>
</body>
</html>